x86/mm: Introduce get_page_from_gfn().
authorTim Deegan <tim@xen.org>
Thu, 17 May 2012 09:24:54 +0000 (10:24 +0100)
committerTim Deegan <tim@xen.org>
Thu, 17 May 2012 09:24:54 +0000 (10:24 +0100)
commit80ea7af1726915471cded5981d33322b14495043
treeb8b51b135ac7f1da0c6801a3aedda91be5a266a5
parent8c160c6e9d16a9969e66c1a878f78bb3c48f5c44
x86/mm: Introduce get_page_from_gfn().

This new function does a p2m lookup under the read lock, falling back
to the write lock only if it needs to make a change.  If the GFN is
backed by RAM, it takes a refcount on the underlying page.

The following patches will convert many paths that currently use
get_gfn/put_gfn to use the new interface.  That will avoid serializing
p2m accesses in the common case where no updates are needed (i.e. no
page-sharing, VM paging or other p2m trickery).

Signed-off-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/p2m.c
xen/include/asm-x86/p2m.h